[Unit]
Description={{docker_container_name}} service
Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service config-setup.service
ConditionPathExists=!/usr/share/sonic/hwsku/gearbox_config.json
After=database{% if multi_instance == 'true' %}@%i{% endif %}.service config-setup.service
After=interfaces-config.service
After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service
BindsTo=sonic.target
After=sonic.target

[Service]
User=root
Environment=sonic_asic_platform={{ sonic_asic_platform }}
Environment=gbsyncd_platform={{ docker_container_name }}
ExecCondition=/usr/bin/gbsyncd-platform.sh
ExecStartPre=/usr/local/bin/gbsyncd.sh start{% if multi_instance == 'true' %} %i{% endif %}
ExecStart=/usr/local/bin/gbsyncd.sh wait{% if multi_instance == 'true' %} %i{% endif %}
ExecStop=/usr/local/bin/gbsyncd.sh stop{% if multi_instance == 'true' %} %i{% endif %}

[Install]
WantedBy=sonic.target
